package 一些算法竞赛测试题;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: a
 * Date: 2022-10-08
 * Time: 15:22
 */

//差分模板
public class Demo11 {
    private static long[] res;

    private static void insert(int l, int r, long x){
        res[l] += x;
        res[r + 1] -= x;
    }

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int Q = scan.nextInt();
        long[] q = new long[N + 1];
        res = new long[N + 2];
        for(int i = 1; i <= N; i++){
            q[i] = scan.nextLong();
        }
        for(int i = 1; i <= N; i++){
            long x = q[i];
            insert(i, i, x);
        }
        for(int i = 0; i < Q; i++){
            int l = scan.nextInt();
            int r = scan.nextInt();
            long x = scan.nextLong();
            insert(l, r, x);
        }
        for(int i = 1; i <= N; i++){
            res[i] += res[i - 1];
            System.out.print(res[i] + " ");
        }
    }
}
